package day34;

import java.util.Scanner;

/**
 * @author tongchen
 * @create 2023-04-23 11:31
 */
public class Main {
    public static void main(String[] args) {
        //定义输入

        Scanner scanner=new Scanner(System.in);
        //定义数字
        while(scanner.hasNext()){
            //创建StringBuilder
            StringBuilder sb=new StringBuilder();
            int n=scanner.nextInt();

           String blank=scanner.nextLine();
            //遍历循环
            for (int i = 0; i < n; i++) {
                String s=scanner.nextLine();
                if(s.contains(",")||s.contains(" ")){
                    //加双引号
                    sb.append("\"");
                    sb.append(s);
                    sb.append("\"");

                }
                else{
                    sb.append(s);

                }
                if(i!=n-1){
                    sb.append(", ");
                }
            }
            System.out.println(sb.toString());
        }


    }
}
